API.sendChat('Michalowsky Bot alpha v0.1 is now running!')

function commands(cmd) {
  cmd = cmd.trim()
  if (cmd == '/dj') {
    API.djJoin();
	API.chatLog("You are now DJ'ing or joined the waitlist.");
  }
  
  if (cmd == '/away') {
  API.sendChat('I am now AFK');
    API.setStatus(AFK);
	
  }
  
  
}
API.on(API.CHAT_COMMAND, commands);

function messages(data) {
  if (data.message == '!dj') {
  API.sendChat( username + "You are now in the DJ Booth / Waitlist!");
  if (data.fromID != API.getUser().id) API.moderateAddDJ(data.fromID);
  else API.djJoin();


}



 var username = data.from;
   var id = data.fromID;
   var msg = data.message;
   if (msg.indexOf("fan me") > -1) {
     API.moderateDeleteChat(data.chatID);
     API.sendChat(username + " please don't ask for fans.");
   }
   
   
   
  




}

API.on(API.CHAT, messages);




API.on(API.DJ_ADVANCE,function(data){
        var hist = API.getHistory();
        for (var i in hist) {
                if (hist[i].media.id == data.media.id) {
                        API.moderateForceSkip();
                        API.sendChat('That song is on the history!');
                        break;
                }
        }
});



